<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript">
function Validate()
	{
		var no=/^[0-9.]+$/;
	var na =/^[a-zA-Z.]+$/;
	if(document.addform.org_name.value=="")
	{
		alert("Organization Name Missing");
		document.addform.org_name.focus();
		return false;
	}
	
	if(document.addform.news_title.value=="")
	{
		alert("News Title Missing");
		document.addform.news_title.focus();
		return false;
	}
	
	if(document.addform.content.value!="")
	{
	  var exp = /^.+\.(DOC|DOCX|PDF|doc|docx|pdf)$/;
		if (!exp.test(document.addform.content.value))
		{				   
			alert("Please Choose DOC,DOCX OR PDF  File");
			return false;
		}	
	}
		
	}
</script>


<form name="addform" action="index.php?tc=news_addcode" method="post" onSubmit="return Validate();" enctype="multipart/form-data">
<?php
if($_REQUEST['News'] == 'true')
{?>
<table align="center" border="0">
	<tr>
    	<td align="center"><div class="sucmsg"><img src="images/information.png" align="absmiddle" />&nbsp;News submitted successfully</div></td>
    </tr>    
    </table>
<?php } ?>
<?php
if($_REQUEST['News'] == 'f')
{?>
<table align="center" border="0">
	<tr>
    	<td align="center"><div class="sucmsg"><img src="images/error.png" align="absmiddle" />&nbsp;Only .doc files can be uploaded.</div></td>
    </tr>    
    </table>
<?php } ?>
<table width="99%" align="center" border="0"  class="list" cellpadding="5">
<thead>
<tr>
	<td colspan="2" align="left">
        <div style="float:left" class="righthead">Add News Details</div>
        <div style="float:right" ><a href="index.php?tc=news" class="back">view News</a></div>
    </td>
</tr>
</thead>
<tr>
	<td align="right" width="150">Your Name</td>
    <td align="left"><input class="text" name="name" type="text"/></td>
</tr>
<tr>
	<td align="right" width="150">Email Address</td>
    <td align="left"><input class="text" name="email" type="text" /></td>
</tr>
<tr>
	<td align="right" width="150">Your Organisation's Name*</td>
    <td align="left"><input class="text" name="org_name" type="text" /></td>
</tr>
<tr>
	<td align="left" width="150">Title of New Item*</td>
    <td align="left"><input class="text" name="news_title" type="text" /></td>
</tr>
<tr>
	<td align="right" width="150">Category</td>
    <td align="left"><select name="category">
                <option value="Other News Items">Other News Items</option>
                <option value="Shire News">Shire News</option>
                <option value="Educational News">Educational News</option>
                <option value="Health Matters">Health Matters</option>
                <option value="Electorate News">Electorate News</option>
                <option value="Mining News">Mining News</option>
            </select></td>
</tr>
<tr>
	<td align="left" width="150" valign="top">News Item Details*</td>
    <td align="left">
    <textarea name="maincont" id="maincont" class="textarea" cols="45" rows="8"></textarea>
        <script type="text/javascript">CKEDITOR.replace( 'maincont',{skin : 'kama'});</script>
   </td>
</tr>
<tr>
	<td align="right" width="150">File *</td>
    <td align="left"><input type="file" name="content" />&nbsp;(Only .doc file can be uploaded)</td>
</tr>
<tr>
	<td align="right" width="150">Are You authorised to report thisNews Item :</td>
    <td align="left"><input  name="authorised" type="radio"  checked="checked" value=1 />&nbsp;Yes&nbsp;&nbsp;
			<input  name="authorised" type="radio" value=0 />&nbsp;No</td>
</tr>
<tr>
	<td align="right" width="150"></td>
    <td colspan="2" align="left"><input type="submit" value="Submit" name="save_news">&nbsp;<input type="reset" name="reset" value="Clear" /></td>
</tr>
</table>
</form>